import {getTakeQrCode} from "@src/api/deposit";

Component({
  options: {
    addGlobalClass: true
  },
  properties: {},
  data: {
    visible: false
  },
  methods: {
    /*数据请求*/
    open(orderCode) {
      return new Promise((resolve, reject) => {
        this.queryTakeQrCode(orderCode);
        this.setData({visible: true, resolve: resolve, reject: reject})
      })
    },
    handleClose() {
      this.data.resolve && this.data.resolve();
      this.setData({visible: false, resolve: null, reject: null})
    },
    handleStop() {
      return true;
    },
    //支取二维码
    queryTakeQrCode(orderCode) {
      let data = {
        orderCode: orderCode
      };
      getTakeQrCode(data).then(res => {
        if (res.code === 0) {
          this.setData({takeQrCodeData: res.data})
        }
      })
    },
  }
});
